package com.itheima.controller;

import com.itheima.cms.entity.CmsPrefrenceArea;
import com.itheima.common.domain.AjaxResult;
import com.itheima.service.ICmsPrefrenceAreaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {
    @Autowired
    private ICmsPrefrenceAreaService cmsPrefrenceAreaService;

    /**
     * 获取所有商品优选
     * @return
     */
    @GetMapping("/listAll")
    public AjaxResult listAll() {
        List<CmsPrefrenceArea> list = cmsPrefrenceAreaService.list();
        return AjaxResult.success(list);
    }
}
